#include <iostream>
#include <stdio.h>
using namespace std;
int main()
{
	int a, b, c,max1;
	double d, e, f,max2;
	cin >> a >> b >> c;
	cin >> d >> e >> f;
	max1 = a > b ? a : b;
	max1 = max1 > c ? max1 :c;
	max2 = d > e ? d : e;
	max2 = max2 > f ? max2 : f;
	cout << max1 << endl;
	cout << max2;
	return 0;
}